﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;
using System.Data;
using Runda.CMS.Bll;

namespace Runda.CMS.Portal.Report
{
    public partial class ContractTrack : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Report_ByRU_Order();
        }

        private void Report_ByRU_Order()
        {
            //set reference
            ReportViewer ReportViewer = ReportViewer1;

            //get rdlc path
            string strRootPath = this.Server.MapPath(this.Request.ApplicationPath);
            string strFilePath = strRootPath + "Report\\rdlc\\ReportContractTrack.rdl";

            //set report viewer property
            ReportViewer.SizeToReportContent = true;
            ReportViewer.ZoomMode = ZoomMode.FullPage;
            ReportViewer.AsyncRendering = false;

            //set report viewer work mode
            ReportViewer.ProcessingMode = ProcessingMode.Local;
            LocalReport lp = ReportViewer.LocalReport;
            lp.ReportPath = strFilePath;

            //get dataset  
            ContractBll bll = new ContractBll();
            DataTable dt = bll.GetContractTrack();
            //set data set
            ReportDataSource rds = new ReportDataSource();
            rds.Name = "DataSource2";
            rds.Value = dt;
            lp.DataSources.Add(rds);
        }

    }
}
